A server used in communication system is configured with a plurality of network cards of which each corresponds to one network port so as to be plugged by a network cable, and the other terminal of the network cable is usually plugged in certain port of a switch which is responsible for forwarding data of the server. At present, in order to detect whether the network cable plugged in the network port of the server is plugged in a correct switch or a correct port of a switch, a method is employed as follows: plugging tentatively a network cable plugged in a network port on a server into certain port of a switch, and then performing a ping operation on an Internet Protocol (IP) address on the network port. The connection of the port of the switch with the network port is correct if the ping operation is validated; plugging the network cable in certain port of next switch if the ping operation is not validated, and repeating continuously the method as described above, until the ping operation is validated. The method as described above is adapted comparatively to a network in which each of the numbers of the servers and switches are not massive, whereas the feasibility thereof is not satisfactory in terms of a system in which there are numerous servers and switches, e.g., a cloud computing system; further, the ping operation is a manual operation, and the operator need to check the result of ping operation on the server and change the network cable to another port of the switch or another switch manually, hence an efficient productivity cannot be achieved by the system if the aforementioned scheme is applied to the cloud computing system.